import http from '@/utils/http'



export default {
    addPost(tt,cc){
        return http({
            url:'/post/publish',
            method:'POST',
            data:{
                title:tt,
                content:cc
            }
        })
    },

    findPostAPI(pageNum,orderBy,order){
        return http({
            url: '/post/list',
            method: 'get',
            params: {
                pageNum:pageNum,
                pageSize:5,
                orderBy:orderBy,
                order:order
            }
        })
    },
    postSearch(key){
        return http({
            url: '/post/findById',
            method: 'get',
            params: {
                id:key
            }
        })
    },
    postreSearch(key){
        return http({
            url: '/post/findRlyByPostId',
            method: 'get',
            params: {
                id:key
            }
        })
    },
    postuserSearch(key) {
        return http({
            url: `/user/findById`,
            method: 'get',
            params: {
                id: key
            }
        })
    },
    postReply(key,content){
        return http({
            url:'/postRly/rlyPost',
            method:'POST',
            data:{
                postId:key,
                content:content

            }
        })
    },
    postList(key){
        return http({
            url:'/post/list',
            method:'GET',
            params:{
                title:key
            }
        })
    },
    myPost(pageNum,order,orderBy,title){
        return http({
            url:'/post/findMyPost',
            method:'GET',
            params:{
                orderBy:orderBy,
                order:order,
                pageNum:pageNum,
                pageSize:5,
                title:title
            }
        })
    },
    deletePost(id){
        return http({
            url:'/post/delete',
            method:'GET',
            params:{
                id:id
            }
        })
    }
}
